package cn.xiu.drugstore.service.impl;

import java.util.List;

import cn.xiu.drugstore.dao.BillDao;
import cn.xiu.drugstore.dao.impl.BillDaoImpl;
import cn.xiu.drugstore.pojo.Bill;
import cn.xiu.drugstore.service.BillService;

/**
 * 账单业务功能接口实现类
 * 
 * @author Administrator
 * 
 */
public class BillServiceImpl implements BillService {
	BillDao dao = new BillDaoImpl();

	@Override
	public Bill queryBillByNId(int billId) {
		try {
			return dao.queryBillByNId(billId);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return null;
	}

	@Override
	public boolean addBill(Bill bill) throws Exception {
		try {
			if (dao.addBill(bill) == 1) {
				return true;
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		return false;
	}

	@Override
	public boolean deleteBill(Bill bill) throws Exception {
		try {
			if (bill != null && dao.deleteBill(bill) == 1) {
				return true;
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		return false;
	}

	@Override
	public List<Bill> queryBillByNId(String start, String over) throws Exception {
		try {
			return dao.CheckDailyBill(start, over);
		} catch (Exception e) {
			// TODO: handle exception
		}
		return null;
	}

}
